/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#include "TextData.h"

namespace liba {
namespace lib3d {
namespace node {

TextData::TextData()
	: alignment(LEFT)
	, normalize(true)
	, valignment(VA_BOTTOM_BASELINE)
	, max_width(-1)
{
}

TextData::TextData(const TextData& rhs)
	: alignment(rhs.alignment)
	, text(rhs.text)
	, normalize(rhs.normalize)
	, max_width(rhs.max_width)
{
}

const TextData& TextData::operator=(const TextData& rhs)
{
	if (&rhs == this)
		return *this;

	alignment = rhs.alignment;
	text = rhs.text;
	normalize = rhs.normalize;

	return *this;
}

TextData::Alignment TextData::GetAlignment() const
{
	return alignment;
}

void TextData::SetAlignment(Alignment value)
{
	alignment = value;
}

const std::wstring& TextData::GetText() const
{
	return text;
}

void TextData::SetText(const std::wstring& value)
{
	text = value;
}

bool TextData::GetNormalize() const
{
	return normalize;
}

void TextData::SetMaxWidth(int val)
{
	max_width = val;
}

int TextData::GetMaxWidth() const
{
	return max_width;
}

void TextData::SetNormalize(bool value)
{
	normalize = value;
}

converter::EnumPair<char, VAlignment> VAlignmentNames[] =
{
	converter::MakeEnumPair( "TOP", VA_TOP ),
	converter::MakeEnumPair( "VA_TOP", VA_TOP ),
	converter::MakeEnumPair( "MIDDLE", VA_MIDDLE ),
	converter::MakeEnumPair( "VA_MIDDLE", VA_MIDDLE ),
	converter::MakeEnumPair( "BOTTOM_BASELINE", VA_BOTTOM_BASELINE),
	converter::MakeEnumPair( "VA_BOTTOM_BASELINE", VA_BOTTOM_BASELINE),
	converter::MakeEnumPair( "BOTTOM_BLOCK", VA_BOTTOM_BLOCK),
	converter::MakeEnumPair( "VA_BOTTOM_BLOCK", VA_BOTTOM_BLOCK),
	0
};

} // namespace node
} // namespace lib3d
} // namespace liba